import request from '@/utils/request'
import { useTokenStore } from '@/stores/token.js'


//  文章分类列表
export const articleCategoryListService =()=>{
  // const tokenStore = useTokenStore()
  // return request.get('/category',{headers:{'Authorization':tokenStore.token}})
  return request.get('/category')
}

//文章分类添加
export const articleCategoryAddServide=(categoryData)=>{
   return request.post('/category',categoryData)

}
// 修改文章分类
export const articleCategoryUpdateService= (categoryData) =>{
    return request.put('/category',categoryData)
}
  // 删除文章分类
  export const articleCategoryDeleteService =(id)=>{
    return request.delete('/category?id='+id)
  }

  //文章列表查询
  export const articleListService =( params )=>{
    return request.get('/article',{params:params})
  }

  //新增文章
  export const articleListAddService = ( articleData)=>{
    return request.post('/article', articleData)
  }

  //更新文章
  export const articleListUpdate = (articleData) =>{
    return request.put('/article', articleData)
  }

  //删除文章
  export const articleDelete = (id)=>{
    return request.delete('/article?id='+id)

  }
